package com.lhwb.escsvinput.vo.conver;

import java.util.List;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.ReadConverterContext;
import com.alibaba.fastjson.JSON;

import com.lhwb.escsvinput.vo.Cast;
import com.lhwb.escsvinput.vo.Genre;
import com.lhwb.escsvinput.vo.Keyword;

public class KeywordListConverter implements Converter<List<Keyword>> {

    @Override
    public List<Keyword> convertToJavaData(ReadConverterContext<?> context) {
        try{
            return JSON.parseArray(context.getReadCellData().getStringValue(), Keyword.class);
        }catch (Exception e) {
            System.out.println("转换失败"+context.getReadCellData().getStringValue());
            e.printStackTrace();
            return null;
        }

    }
}
